package com.zhoushihao.class0806;

import java.util.Arrays;
import java.util.Scanner;

public class SendCare {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int sum = 0;
        int count = 0;
        for (int i = 0; i < n; i++) {
            sum += arr[i];
            if(sum >= k){
                count++;
                sum = 0;
            }else{
                if(i==n-1) count++;
                sum += arr[i];
            }
        }
        System.out.println(count);
    }
}
